/**
 * 
 */
package us.gaaoc.framework.dao;

import org.hibernate.Query;

import us.gaaoc.framework.model.Court;
import us.gaaoc.framework.model.LocalCaseCategory;

/**
 * 
 * @author hea
 * May 18, 2007
 */
public class LocalCaseCategoryDAOHibernate extends GenericHibernateDAO<LocalCaseCategory, Integer, LocalCaseCategoryDAO> implements
LocalCaseCategoryDAO {

	/* (non-Javadoc)
	 * @see us.gaaoc.framework.dao.LocalCaseCategoryDAO#findLocalCaseCategoryByCode(java.lang.String)
	 */
	public LocalCaseCategory findLocalCaseCategoryByCourtandCode(Court court, String code) {
		
		Query q = this.getSession().createQuery("from LocalCaseCategory c where c.court = ? and c.cmsCode = ? ");
		q.setEntity(0, court);
        q.setString(1, code);
        return (LocalCaseCategory)q.uniqueResult();
	}
	
}
